Skip to content

Conversation

@vgreb
Copy link
Collaborator

@vgreb vgreb commented Dec 9, 2025

J'ai un peu modifié la gestions des lignes de devis sur la page d'ajout/modification d'un devis. On peut maintenant rajouter une ligne au besoin.

Avant :
devis-avant

Après :
devis-après

La gestion des lignes est faite en javascript, pour pouvoir tester cel, j'ai dû rajouter la possibilité de faire des tests avec un vrai navigatuer. Les tests necessitant du javascript sont pilotés avec Behat via Panther sur le navigateur Chromium.

@vgreb vgreb self-assigned this Dec 9, 2025
@vgreb
Copy link
Collaborator Author

vgreb commented Dec 9, 2025

resolves #2002

@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch 6 times, most recently from 686683e to 15cc2a5 Compare December 16, 2025 20:40
@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch 8 times, most recently from 556dddb to 0034d1f Compare December 20, 2025 21:30
@vgreb vgreb marked this pull request as ready for review December 20, 2025 22:03
@vgreb vgreb requested review from Mopolo and stakovicz December 20, 2025 22:03
@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch from 0034d1f to eef10b5 Compare December 23, 2025 21:45
@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch from eef10b5 to 257149a Compare January 12, 2026 11:24
Copy link
Contributor

@stakovicz stakovicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gros boulot ! Bravo !
Il reste aussi des commentaires non résolus.

@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch 4 times, most recently from 9f239ee to 7e2ca90 Compare January 29, 2026 06:30
@vgreb
Copy link
Collaborator Author

vgreb commented Jan 29, 2026

@stakovicz @Mopolo j'ai implémenté une solution plus propre que le "wait Xs" dans les tests behat. Je retente l'assertion toutes les 100ms pendant un temps donné (cf. Afup\Tests\Behat\Bootstrap\WaitContext).

Copy link
Contributor

@Mopolo Mopolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est beaucoup mieux le wait que t'as fait là !

Faudra voir à l'usage si on besoin de setup du retry auto de ces tests.

Quelques remarques encore mais je trouve qu'on approche du merge :)

'scale' => 2,
])->add('unitPrice', NumberType::class, [
'label' => 'Prix unitaire HT',
'required' => false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vu que les lignes peuvent maintenant être ajoutées dynamiquement, pourquoi ne pas forcer les colonnes non-nullables ?

Là ça veut dire que si je clic sur le bouton pour en ajouter 3 et que j'en rempli 2, la 3ème sera ignorée.
Avec l'ancien système ça ne posait pas de soucis vu que les 5 étaient en dur. Mais là je trouve ça dommage et contre-intuitif, on n'est plus sûr de ce qui sera enregistré ou pas.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

les champs sont maintenant requis pour pouvoir valider le formulaire. La validation du navigateur va empêcher la soumission. Si une ligne est vide à la soumission, il faudra explicitement le retirer.

$idsToRemove = $this->invoicingDetailRepository->getRowsIdsPerInvoicingId($quotation->getId());
$existingIds = [];
$this->invoicingRepository->startTransaction();
$this->unitOfWork->pushSave($quotation);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne maitrise pas du tout Ting, c'est nécessaire ça vu qu'il y a ça plus bas ?

$this->invoicingRepository->save($quotation);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L'utilisation de l'unitOfWork permet prendre en compte les modifications sur des entités de différents type sans pour autant passer par le "bon" repository.
Là les 2 repository sont déjà injecté alors ça ne faisait pas vraiment de sens d'injecter en plus l'unitOfWork. Je l'ai retiré.

@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch 5 times, most recently from 9005b8b to 591ecd9 Compare February 3, 2026 08:48
@vgreb
Copy link
Collaborator Author

vgreb commented Feb 3, 2026

@Mopolo dans les test Behat on crée un devis sans remplir une seule ligne de détail.

Est-ce que ce cas d'usage est vraiment représentatif ?

@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch 2 times, most recently from 35123e6 to 88c061b Compare February 3, 2026 22:24
@vgreb vgreb force-pushed the refacto/accounting-quotation-add-edit branch from 88c061b to 4d9cec1 Compare February 3, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants